package com.zd.jdbc;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import java.util.List;

public class TestCustomerDAOImpl {

    private CustomerDAO customerDAO = null;

    @Before
    public void init(){
        customerDAO = new CustomerDAOImpl();
    }

    @Test
    public void testAdd(){
        customerDAO.add(new Customer());
    }

    @Test
    public void testLoad(){
        Customer customer = customerDAO.load(20005L);

        System.out.println(customer);
    }

    @Test
    public void testList(){
        List<Customer> list = customerDAO.list();

        for(Customer customer : list){
            System.out.println(customer);
        }
    }

    @After
    public void destroy(){
        customerDAO = null;
    }

}
